﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;

namespace IPTV_Playlist_Editor
{
    public class Channel : INotifyPropertyChanged
    {
        private int _id, _port;
        private string _name, _tag, _language, _ip, _epg, _image;
        public event PropertyChangedEventHandler PropertyChanged;

        public Channel(int id, string name, string tag, string language, string epg, string ip, int port)
        {
            _id = id;
            _name = name;
            _tag = tag;
            _language = language;
            _ip = ip;
            _port = port;
            _epg = epg;
        }

        public Channel(int id, string name, string tag, string language, string epg, string ip, int port, string image)
        {
            _id = id;
            _name = name;
            _tag = tag;
            _language = language;
            _ip = ip;
            _port = port;
            _epg = epg;
            _image = image;
        }

        public int ID
        {
            get { return _id; }
            set
            {
                _id = value;
                this.NotifyPropertyChanged("ID");
            }
        }

        public string Name
        {
            get { return _name; }
            set
            {
                _name = value;
                this.NotifyPropertyChanged("Name");
            }
        }

        public string Tag
        {
            get { return _tag; }
            set
            {
                _tag = value;
                this.NotifyPropertyChanged("Tag");
            }
        }

        public string Language
        {
            get { return _language; }
            set
            {
                _language = value;
                this.NotifyPropertyChanged("Language");
            }
        }

        public string IP
        {
            get { return _ip; }
            set
            {
                _ip = value;
                this.NotifyPropertyChanged("IP");
            }
        }

        public int Port
        {
            get { return _port; }
            set
            {
                _port = value;
                this.NotifyPropertyChanged("Port");
            }
        }

        public string EPG
        {
            get { return _epg; }
            set
            {
                _epg = value;
                this.NotifyPropertyChanged("EPG");
            }
        }

        public string Image
        {
            get { return _image; }
            set
            {
                _image = value;
                this.NotifyPropertyChanged("Image");
            }
        }

        private void NotifyPropertyChanged(string value)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(value));
        }
    }
}
